﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MaxLeaf.Platform.Contract;
using MaxLeaf.Platform.BLLImplementation;
using CommonsLib.Utility;
using MaxLeaf.Platform.DataContract;
using CommonsLib.Settings;
using MaxLeaf.Platform.Functions;

namespace MaxLeaf.Platform.BLLProxy
{
    public class TestBLLProxy : BaseBLLProxy, ITest
    {

        ITest bll;
        public TestBLLProxy():base()
        {
            switch ( Access_Mode )
            {

                case MaxLeaf.Platform.Commons.Const.ACCESS_Direct:
                    {
                        bll = new TestBLL();
                        break;
                    }

                case MaxLeaf.Platform.Commons.Const.ACCESS_IIS:
                    {
                        bll = new TestBLLWCFClient(this.WCF_Configs);
                        break;
                    }


                default:
                    {
                        throw new MaxLeaf.Platform.Commons.MaxLeafException(MaxLeaf.Platform.Commons.Const.EXCEPTION_MESSAGE_INVALID_ACCESSMODE_CONFIG);

                    }
            }
        }




        public TestDataModel SayHello(TestDataModel user)
        {
            LogManager.Debug("BllproxySayHello ");
            return bll.SayHello(user);
        }

        public string ShowError(string strName)
        {
            return bll.ShowError(strName);
        }
 
    }
}
